#!/bin/env python2 

#import ssl
import socket
from M2Crypto import RSA, X509
from ssloverride import get_server_certificate

class Fetcher():
    def __init__(self):
        ""
    def __repr__(self):
        ""
        return "Fetcher class"
    def FetchCert(self, host, port):
        try:
            cert = get_server_certificate((host, port))
            return cert
        except socket.error:
            return
    def FetchAndGet(self, host, port):
        pem = self.FetchCert(host, port)
        if pem:
            return host, port, pem
        else:
            return host, port

        
        

